package org.bogusware.json.editor;

import org.eclipse.jface.text.rules.IWordDetector;

public class JSONConstantDetector implements IWordDetector {

	private final char constantsStarts[] = { 't', 'f', 'n' };
	private final char constnatsContent[] = { 'r', 'u', 'e', 'a', 'l', 's', 'u' };

	@Override
	public boolean isWordPart(char c) {
		for (char part : constnatsContent) {
			if (c == part) {
				return true;
			}
		}
		return false;
	}

	@Override
	public boolean isWordStart(char c) {
		for (char start : constantsStarts) {
			if (start == c) {
				return true;
			}
		}
		return false;
	}

}
